package com.solocredit.finance.utils.track;

import android.content.Context;

import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;


@Database(entities = {FlexiMolaTrackEvent.class}, version = 1, exportSchema = false)
public abstract class FlexiMolaTrackDatabase extends RoomDatabase {
    public abstract FlexiMolaTrackEventDao eventDao();

    private static volatile FlexiMolaTrackDatabase INSTANCE;

    public static FlexiMolaTrackDatabase getDatabase(final Context context) {
        if (INSTANCE == null) {
            synchronized (FlexiMolaTrackDatabase.class) {
                if (INSTANCE == null) {
                    INSTANCE = Room.databaseBuilder(context.getApplicationContext(), FlexiMolaTrackDatabase.class, "fleximola_track.db").build();
                }
            }
        }
        return INSTANCE;
    }
}
